package com.alpha.eceasy.auth;

import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 统一鉴权接口，
 * 不同模块通过重载实现自定义鉴权规则
 *
 * @param <T> 子模块用户实体
 */
public interface BaseUserDetailsService<T> extends UserDetailsService {
    /**
     * 登录流程使用
     *
     * @param username the username identifying the user whose data is required.
     * @return a fully populated user record (never <code>null</code>)
     * @throws UsernameNotFoundException if the user could not be found or the user has no
     *                                   GrantedAuthority
     */
    @Override
    LoginUser<T> loadUserByUsername(String username) throws UsernameNotFoundException;
}
